{% extends 'usercenter_base.html' %}

{% load staticfiles %}

{% block title %} 个人信息 {% endblock %}


{% block body %}
<section>
    <div class="wp list personal_list">
        <div class="left">
            <ul>
                <li class="{% ifequal request.path|slice:'15' '/users/userinfo' %}active2{% endifequal %}"><a href="{% url 'users:userinfo' %}">个人资料</a></li>
                <li class="{% ifequal request.path|slice:'15' '/users/mycourse' %}active2{% endifequal %}"><a href="{% url 'users:mycourse' %}">我的课程</a></li>
                <li class="{% ifequal request.path|slice:'12' '/users/myfav' %}active2{% endifequal %}"><a href="{% url 'users:myfavorg' %}">我的收藏</a></li>
                <li class="{% ifequal request.path|slice:'16' '/users/mymessage' %}active2{% endifequal %}">
                    <a href="{% url 'users:mymessage' %}" style="position: relative;">
                        我的消息
                    </a>
                </li>
            </ul>
        </div>

        <div class="right">
            <div class="personal_des ">
                <div class="head" style="border:1px solid #eaeaea;">
                    <h1>个人信息</h1>
                </div>
                <div class="inforcon">
                    <div class="left" style="width:242px;">
                        <iframe id='frameFile' name='frameFile' style='display: none;'></iframe>
{#修改头像#}
                        <form class="clearfix" id="jsAvatarForm" enctype="multipart/form-data" autocomplete="off"
                              method="post" action="{% url 'users:uploadimage' %}" target='frameFile'>
                                            <label class="changearea" for="avatarUp">
                                                <span id="avatardiv" class="pic">
                                                    <img width="100" height="100" class="js-img-show" id="avatarShow"
                                                         src="{{ MEDIA_URL }}{{ request.user.image }}"/>
                                                </span>
                                                <span class="fl upload-inp-box" style="margin-left:70px;">
                                                    <span class="button btn-green btn-w100" id="jsAvatarBtn">修改头像</span>
                                                    <input type="file" name="image" id="avatarUp" class="js-img-up"/>
                                                </span>
                                            </label>
                            {% csrf_token %}
                        </form>
{#修改密码#}
                        <div style="border-top:1px solid #eaeaea;margin-top:30px;">
                            <a class="button btn-green btn-w100" id="jsUserResetPwd"
                               style="margin:80px auto;width:100px;">修改密码</a>
                        </div>
                    </div>
{#修改基本信息#}
                    <form class="perinform" id="jsEditUserForm" autocomplete="off">
                        <ul class="right">
                            <li>昵&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称：
                                <input type="text" name="nick_name" id="nick_name"
                                       value="{{ request.user.nick_name }}" maxlength="10">
                                <i class="error-tips"></i>
                            </li>
                            <li>生&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;日：
                                <input type="text" id="birth_day" name="birthday"
                                       value="{{ request.user.birthday }}" readonly="readonly"/>
                                <i class="error-tips"></i>
                            </li>
                            <li>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别：
                                {% if request.user.gender == 'male' %}
                                    <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="gender"
                                                                                value="male"
                                                                                checked="checked">男</label>
                                    <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="gender"
                                                                                      value="female">女</label>

                                {% else %}
                                    <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="gender"
                                                                                value="male">男</label>
                                    <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="gender"
                                                                                      value="female"
                                                                                      checked="checked">女</label>
                                {% endif %}
                            </li>
                            <li class="p_infor_city">地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址：
                                <input type="text" name="address" id="address" placeholder="请输入你的地址"
                                       value="{{ request.user.address }}" maxlength="10">
                                <i class="error-tips"></i>
                            </li>
                            <li>手&nbsp;&nbsp;机&nbsp;&nbsp;号：
                                <input type="text" name="mobile" id="mobile" placeholder="请输入你的手机号码"
                                       value="{{ request.user.mobile }}" maxlength="10">
                            </li>
                            <li>邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;箱：
                                <input class="borderno" type="text" name="email" readonly="readonly"
                                       value="{{ request.user.email }}"/>
                                <span class="green changeemai_btn">[修改]</span>
                            </li>
                            <li class="button heibtn">
                                <input type="button" id="jsEditUserBtn" value="保存">
                            </li>
                        </ul>
                    {% csrf_token %}
                    </form>
                </div>
            </div>
        </div>


    </div>

</section>
    <div class="dialog" id="jsDialog">
        <div class="successbox dialogbox" id="jsSuccessTips">
            <h1>成功提交</h1>
            <div class="close jsCloseDialog"><img src="{% static 'images/dig_close.png' %}"/></div>
            <div class="cont">
                <h2>您的需求提交成功！</h2>
                <p></p>
            </div>
        </div>
        <!--提示弹出框-->
        <div class="bidtips dialogbox promptbox" id="jsComfirmDialig">
            <h1>确认提交</h1>
            <div class="close jsCloseDialog"><img src="{% static 'images/dig_close.png' %}"/></div>
            <div class="cont">
                <h2>您确认提交吗？</h2>
                <dd class="autoTxtCount">
                    <div class="button">
                        <input type="button" class="fl half-btn" value="确定" id="jsComfirmBtn"/>
                        <span class="fr half-btn jsCloseDialog">取消</span>
                    </div>
                </dd>
            </div>
        </div>
{#修改密码小窗口#}
        <div class="resetpwdbox dialogbox" id="jsResetDialog">
            <h1>修改密码</h1>
            <div class="close jsCloseDialog"><img src="{% static 'images/dig_close.png' %}"/></div>
            <div class="cont">
                <form id="jsResetPwdForm" autocomplete="off">
                    <div class="box">
                        <span class="word2">新&nbsp;&nbsp;密&nbsp;&nbsp;码</span>
                        <input type="password" id="pwd" name="password1" placeholder="6-20位非中文字符"/>
                    </div>
                    <div class="box">
                        <span class="word2">确定密码</span>
                        <input type="password" id="repwd" name="password2" placeholder="6-20位非中文字符"/>
                    </div>
                    <div class="error btns" id="jsResetPwdTips"></div>
                    <div class="button">
                        <input id="jsResetPwdBtn" type="button" value="提交"/>
                    </div>
                    {% csrf_token %}
                </form>
            </div>
        </div>
{#修改邮箱#}
        <div class="dialogbox changeemai1 changephone" id="jsChangeEmailDialog">
            <h1>修改邮箱</h1>
            <div class="close jsCloseDialog"><img src="{% static 'images/dig_close.png' %}"/></div>
            <p>请输入新的邮箱地址</p>
            <form id="jsChangeEmailForm" autocomplete="off">
                <div class="box">
                    <input class="fl change_email" name="email" id="jsChangeEmail" type="text"
                           placeholder="输入重新绑定的邮箱地址">
                </div>
                <div class="box">
                    <input class="fl email_code" type="text" id="jsChangeEmailCode" name="code" placeholder="输入邮箱验证码">
                    <input class="getcode getting" type="button" id="jsChangeEmailCodeBtn" value="获取验证码">
                </div>
                <div class="error btns change_email_tips" id="jsChangeEmailTips">请输入...</div>
                <div class="button">
                    <input class="changeemai_btn" id="jsChangeEmailBtn" type="button" value="完成"/>
                </div>
                <input type='hidden' name='csrfmiddlewaretoken' value='DaP7IUKm9FA9nELA9YUlYYWpyIDdCiIP'/>
                <input type='hidden' name='csrfmiddlewaretoken' value='799Y6iPeEDNSGvrTu3noBrO4MBLv6enY'/>
            </form>
        </div>

        <div class="noactivebox dialogbox" id="jsUnactiveForm">
            <h1>邮件验证提示</h1>
            <div class="close jsCloseDialog"><img src="{% static 'images/dig_close.png' %}"/></div>
            <div class="center">
                <img src="{% static 'images/send.png' %}"/>
                <p>我们已经向您的邮箱<span class="green" id="jsEmailToActive">12@13.com</span>发送了邮件，<br/>为保证您的账号安全，请及时验证邮箱</p>
                <p class="a"><a class="btn" id="jsGoToEmail" target="_blank" href="http://mail.qq.com">去邮箱验证</a></p>
                <p class="zy_success upmove"></p>
                <p style="display: none;" class="sendE2">没收到，您可以查看您的垃圾邮件和被过滤邮件，也可以再次发送验证邮件（<span class="c5c">60s</span>）
                </p>
                <p class="sendE">没收到，您可以查看您的垃圾邮件和被过滤邮件，<br/>也可以<span class="c5c green" id="jsSenEmailAgin"
                                                                     style="cursor: pointer;">再次发送验证邮件</span></p>
            </div>
        </div>
{#修改密码#}
        <div class="resetpassbox dialogbox" id="jsSetNewPwd">
            <h1>重新设置密码</h1>
            <div class="close jsCloseDialog"><img src="{% static 'images/dig_close.png' %}"/></div>
            <p class="green">请输入新密码</p>
            <form id="jsSetNewPwdForm">
                <div class="box">
                    <span class="word2">密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码</span>
                    <input type="password" name="password" id="jsResetPwd" placeholder="请输入新密码"/>
                </div>
                <div class="box">
                    <span class="word2">确&nbsp;认&nbsp;密&nbsp;码</span>
                    <input type="password" name="password2" id="jsResetPwd2" placeholder="请再次输入新密码"/>
                </div>
                <div class="box">
                    <span class="word2">验&nbsp;&nbsp;证&nbsp;&nbsp;码</span>
                    <input type="text" name="code" id="jsResetCode" placeholder="请输入手机验证码"/>
                </div>
                <div class="error btns" id="jsSetNewPwdTips"></div>
                <div class="button">
                    <input type="hidden" name="mobile" id="jsInpResetMobil"/>
                    <input id="jsSetNewPwdBtn" type="button" value="提交"/>
                </div>
                <input type='hidden' name='csrfmiddlewaretoken' value='DaP7IUKm9FA9nELA9YUlYYWpyIDdCiIP'/>
            </form>
        </div>
        <div class="forgetbox dialogbox">
            <h1>忘记密码</h1>
            <div class="close jsCloseDialog"><img src="{% static 'images/dig_close.png' %}"/></div>
            <div class="cont">
                <form id="jsFindPwdForm" autocomplete="off">
                    <input type='hidden' name='csrfmiddlewaretoken' value='DaP7IUKm9FA9nELA9YUlYYWpyIDdCiIP'/>
                    <div class="box">
                        <span class="word2">账&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号</span>
                        <input type="text" id="account" name="account" placeholder="手机/邮箱"/>
                    </div>
                    <div class="box">
                        <span class="word3">验证码</span>
                        <input autocomplete="off" class="form-control-captcha find-password-captcha"
                               id="find-password-captcha_1" name="captcha_f_1" placeholder="请输入验证码" type="text"/> <input
                            class="form-control-captcha find-password-captcha" id="find-password-captcha_0"
                            name="captcha_f_0" placeholder="请输入验证码" type="hidden"
                            value="5f3c00e47fb1be12d2fd15b9a860711597721b3f"/> &nbsp;<img
                            src="/captcha/image/5f3c00e47fb1be12d2fd15b9a860711597721b3f/" alt="captcha"
                            class="captcha"/>
                    </div>
                    <div class="error btns" id="jsForgetTips"></div><!--忘记密码错误-->
                    <div class="button">
                        <input type="hidden" name="sms_type" value="1">
                        <input id="jsFindPwdBtn" type="button" value="提交"/>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="bg" id="dialogBg"></div>

{% endblock %}
